Revisiting the CPS Transformation and its Implementation
نویسنده
چکیده
We give a machine-checked definition and proof of semantic correctness for Danvy and Filinski’s properly tail-recursive, one-pass, call-by-value CPS transformation. We do so in the setting of the pure λ -calculus extended with a let construct. We propose a new first-order, one-pass, compositional formulation of the transformation. We point out that Danvy and Filinski’s simulation diagram does not hold in the presence of let, and prove a slightly more complex diagram, which involves parallel reduction. We represent variables as de Bruijn indices and show that, given the current state of the art, this does not represent a significant impediment to formalization. Finally, we note that, given this representation of terms, it is not obvious how to efficiently implement the transformation. To address this issue, we propose a novel higher-order formulation of the transformation. We prove that it is correct and informally argue that it runs in time O(n logn).
منابع مشابه
The Occurrence of Continuation Parameters in Cps Terms
We prove an occurrence property about formal parameters of continuations in Continuation-Passing Style (CPS) terms that have been automatically produced by CPS transformation of pure, call-by-value-terms. Essentially, parameters of continuations obey a stack-like discipline. This property was introduced, but not formally proven, in an earlier work on the Direct-Style transformation (the inverse...
متن کاملRevisiting Beta 2 Glycoprotein I, the Major Autoantigen in the Antiphospholipid Syndrome
Beta 2 glycoprotein I (β2GPI) is a single chain 50 kDa highly glycosylated glycoprotein at an approximate concentration of 4 μM in cells. The abundance of this protein in plasma and its high state of preservation indicate the important role of this protein in mammalian. In addition, β2GPI has a particular structure in the fifth domain, and is categorized as the major antigen recognized by autoa...
متن کاملThe Package for Mental and Social Health Promotion and Drug Abuse Prevention in the Health Transformation Plan: Executive Leadership Challenges and Suggestions
Background and Aim: The “Package for mental and social health promotion and drug abuse prevention” was developed in response to the importance of, and concerns relate to, the mental and social health in the population. Since any policy and plan needs to be assessed to find its weaknesses, strengths and challenges to ensure its successful implementation, this study aimed to find and explain the ...
متن کاملA static simulation of dynamic delimited control
We present a continuation-passing-style (CPS) transformation for some dynamic delimited-control operators, including Felleisen’s control and prompt, that extends a standard call-by-value CPS transformation. Based on this new transformation, we show how Danvy and Filinski’s static delimited-control operators shift and reset simulate dynamic operators, allaying in passing some skepticism in the l...
متن کاملOn proving syntactic properties of CPS
Higher-order program transformations raise new challenges for proving properties of their output, since they resist traditional, rst-order proof techniques. In this work, we consider (1) the \one-pass" continuation-passing style (CPS) transformation, which is second-order, and (2) the occurrences of parameters of continuations in its output. To this end, we specify the one-pass CPS transformati...
متن کامل